<?php

include 'header.php';
include 'footer.php';
include 'dbOper.php';

if(isset($_POST['submit']))
{
	$username = $_POST['uname'];
	$password = $_POST['pword'];
	
	$db = new DBConnect();
	$login = $db->loginCheck($username, $password);

	if($login)
	{
		session_start();
		
		$_SESSION['username'] = $_POST['uname'];
		header("Location: index.php");
	}
}
?>

<form action="<?php $_SERVER['PHP_SELF']?>" method="post">
<div class="input">Username: </div><input type="text" name="uname" placeholder="Your username">
<div class="input">Password:</div><input type="password" name="pword" placeholder="Your password">
<div class="input">&nbsp;&nbsp;&nbsp;</div><input type="submit" name="submit" value="Enter">
</form>
